package com.woniu.springsecurity.service.impl;

import com.woniu.springsecurity.entity.User;
import com.woniu.springsecurity.mapper.UserMapper;
import com.woniu.springsecurity.service.CustomUserDetailService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CustomUserDetailServiceImpl implements CustomUserDetailService {
    @Resource
    private UserMapper userMapper;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return userMapper.findByUsername(username);
    }
}
